import 'package:taonile/generated/json/base/json_convert_content.dart';
import 'package:taonile/entity/goods_source_list_entity.dart';

GoodsSourceListEntity $GoodsSourceListEntityFromJson(Map<String, dynamic> json) {
	final GoodsSourceListEntity goodsSourceListEntity = GoodsSourceListEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		goodsSourceListEntity.code = code;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		goodsSourceListEntity.msg = msg;
	}
	final List<GoodsSourceListData>? data = jsonConvert.convertListNotNull<GoodsSourceListData>(json['data']);
	if (data != null) {
		goodsSourceListEntity.data = data;
	}
	return goodsSourceListEntity;
}

Map<String, dynamic> $GoodsSourceListEntityToJson(GoodsSourceListEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['data'] =  entity.data.map((v) => v.toJson()).toList();
	return data;
}

GoodsSourceListData $GoodsSourceListDataFromJson(Map<String, dynamic> json) {
	final GoodsSourceListData goodsSourceListData = GoodsSourceListData();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		goodsSourceListData.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		goodsSourceListData.name = name;
	}
	final String? imgPath = jsonConvert.convert<String>(json['img_path']);
	if (imgPath != null) {
		goodsSourceListData.imgPath = imgPath;
	}
	final String? sourceKey = jsonConvert.convert<String>(json['source_key']);
	if (sourceKey != null) {
		goodsSourceListData.sourceKey = sourceKey;
	}
	final String? sort = jsonConvert.convert<String>(json['sort']);
	if (sort != null) {
		goodsSourceListData.sort = sort;
	}
	final String? xSwitch = jsonConvert.convert<String>(json['switch']);
	if (xSwitch != null) {
		goodsSourceListData.xSwitch = xSwitch;
	}
	final String? createdAt = jsonConvert.convert<String>(json['created_at']);
	if (createdAt != null) {
		goodsSourceListData.createdAt = createdAt;
	}
	final String? updatedAt = jsonConvert.convert<String>(json['updated_at']);
	if (updatedAt != null) {
		goodsSourceListData.updatedAt = updatedAt;
	}
	return goodsSourceListData;
}

Map<String, dynamic> $GoodsSourceListDataToJson(GoodsSourceListData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['img_path'] = entity.imgPath;
	data['source_key'] = entity.sourceKey;
	data['sort'] = entity.sort;
	data['switch'] = entity.xSwitch;
	data['created_at'] = entity.createdAt;
	data['updated_at'] = entity.updatedAt;
	return data;
}